/* 搜索页面特定样式 */

/* 通用样式 */
.search-container {
    width: 100%;
    padding: 20px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-container.centered {
    display: flex;
    flex-direction: column;
    justify-content: top;
    align-items: center;
    min-height: 80vh;
}

.search-container.top {
    height: auto;
    padding-top: 20px;
    min-height: auto;
    justify-content: flex-start;
}

.search-header {
    margin-bottom: 20px;
    text-align: center;
}

.search-header h1 {
    font-family: 'Product Sans', Arial, sans-serif;
    font-size: 28px;
    color: #202124;
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    width: 100%;
    max-width: 584px;
    margin: 0 auto;
    border-radius: 24px;
    border: 1px solid #dfe1e5;
    box-shadow: 0 1px 6px rgba(32,33,36,0.28);
    padding: 8px 16px;
}

.search-box:hover, .search-box:focus-within {
    box-shadow: 0 1px 6px rgba(32,33,36,0.28);
    border-color: rgba(223,225,229,0);
}

#search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #202124;
}

#search-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 8px;
}

.search-icon {
    width: 24px;
    height: 24px;
    fill: #4285f4;
}

.search-tabs {
    display: flex;
    margin: 20px auto;
    border-bottom: 1px solid #dfe1e5;
    padding-left: 10px;
    justify-content: center;
    max-width: 584px;
    width: 100%;
}

.search-tab {
    padding: 0 16px 12px;
    margin-right: 12px;
    color: #5f6368;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    text-align: center;
}

.search-tab.active {
    color: #1a73e8;
    font-weight: 500;
}

.search-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: #1a73e8;
}

/* 加载和错误提示 */
.loading-results {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading-results img {
    width: 40px;
}

.loading-results p {
    color: #5f6368;
    margin-top: 10px;
}

.error {
    display: none;
    text-align: center;
    color: #d93025;
    padding: 10px;
    margin: 10px 0;
}

/* 通用结果样式 */
.results-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* 结果统计信息 */
.results-stats {
    color: #70757a;
    font-size: 14px;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.result-item {
    margin-bottom: 30px;
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.result-title {
    font-size: 20px;
    line-height: 1.3;
    color: #1a0dab;
    text-decoration: none;
    font-weight: normal;
    display: block;
    margin-bottom: 3px;
}

.result-title:hover {
    text-decoration: underline;
}

.result-link {
    color: #202124;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 3px;
}

.result-snippet {
    color: #545454;
    font-size: 14px;
    line-height: 1.58;
}

/* 图片搜索结果 */
.image-results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-start;
    width: 100%;
    max-width: 90%;
    margin: 0 auto;
}

.image-result-item {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    width: 200px;
    margin-bottom: 16px;
    transition: transform 0.2s;
}

.image-result-item:hover {
    transform: translateY(-3px);
}

.image-result-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #f0f0f0;
}

.image-result-title {
    font-size: 14px;
    color: #1a0dab;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-result-link {
    font-size: 12px;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 视频搜索结果 */
.video-result-item {
    display: flex;
    margin-bottom: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.video-thumbnail-container {
    flex: 0 0 200px;
    margin-right: 16px;
    position: relative;
}

.video-thumbnail {
    width: 100%;
    height: 112px;
    object-fit: cover;
    border-radius: 8px;
}

.video-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 12px;
}

.video-content {
    flex: 1;
}

/* 新闻搜索结果 */
.news-result-item {
    display: flex;
    margin-bottom: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.news-thumbnail {
    flex: 0 0 120px;
    margin-left: 16px;
}

.news-thumbnail img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.news-content {
    flex: 1;
}

.news-source {
    font-size: 12px;
    color: #202124;
    font-weight: bold;
    margin-bottom: 4px;
}

.news-time {
    font-size: 12px;
    color: #70757a;
    margin-left: 8px;
}

/* 分页控件样式 */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px auto;
    flex-wrap: wrap;
    max-width: 800px;
}

.pagination-button {
    padding: 10px 16px;
    margin: 0 4px;
    color: #4285f4;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.pagination-button:hover {
    background-color: #f1f3f4;
}

.pagination-button.active {
    color: #000;
    font-weight: bold;
    background-color: #f1f3f4;
    cursor: default;
}

.pagination-ellipsis {
    padding: 10px 8px;
    color: #70757a;
    font-size: 14px;
}

/* 响应式分页样式 */
@media (max-width: 600px) {
    .pagination-container {
        margin: 20px auto;
    }
    
    .pagination-button {
        padding: 8px 12px;
        margin: 0 2px;
        font-size: 13px;
    }
}

/* 响应式布局调整 */
@media (max-width: 768px) {
    .search-container {
        padding: 15px 10px;
    }
    .search-box {
        max-width: 95%;
    }
    .results-container {
        padding: 0 8px;
    }
    .result-item {
        max-width: 100%;
    }
    .image-results-grid {
        justify-content: space-around;
        gap: 12px;
    }
    .image-result-item {
        width: 160px;
    }
    .image-result-thumbnail {
        height: 140px;
    }
    
    /* 视频布局响应式调整 */
    .video-result-item {
        flex-direction: column;
        max-width: 600px;
    }
    .video-thumbnail-container {
        flex: none;
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }
    .video-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
}

@media (max-width: 480px) {
    .image-result-item {
        width: 140px;
    }
    .image-result-thumbnail {
        height: 120px;
    }
    
    /* 新闻布局响应式调整 */
    .news-result-item {
        flex-direction: column;
    }
    .news-thumbnail {
        flex: none;
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }
    .news-thumbnail img {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
}

/* 对于超大屏幕，进一步优化图片布局 */
@media (min-width: 1200px) {
    .image-results-grid {
        max-width: 85%;
    }
}

@media (min-width: 1600px) {
    .image-results-grid {
        max-width: 80%;
    }
}

/* 无搜索结果样式 */
.no-results {
    text-align: center;
    color: #5f6368;
    padding: 30px;
    margin: 0 auto;
    font-size: 16px;
}

.search-container.centered .search-tabs {
    margin-top: 10px;
}

.search-container.top .search-tabs {
    margin-top: 20px;
} 